#pragma once
#include "DLL.h"
#include "IEventReceiver.h"
#include <allegro5\allegro.h>
namespace DarkStorm2D {
namespace SystemCore {
	class DLLDARKSTORM2D CTimer : public IEventReceiver
	{
	protected:
		ALLEGRO_TIMER* m_Timer;
		float m_FPS;
	public:
		friend class CEventQueue;
		CTimer()
		{
			m_FPS = 60;
			m_Timer = al_create_timer(1.0f / m_FPS);
		}

		CTimer(float FPS)
		{
			m_FPS = FPS;
			m_Timer = al_create_timer(1.0f / m_FPS);
		}

		~CTimer()
		{
			al_destroy_timer(m_Timer);
		}

		inline void Start() { al_start_timer(m_Timer);}
		inline void Stop()  { al_stop_timer(m_Timer) ;}
	};
};
};

